<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
    <title>React 学习！！</title>
</head>
<body>
<div id="app"></div>
<script src="../bower_components/react/react.min.js"></script>
<script src="../bower_components/react/react-dom.min.js"></script>
<script src="../bower_components/react/browser.min.js"></script>
<script type="text/babel">
    var ClickApp = React.createClass({
        getInitialState: function () {
            return {
                clickCount: 0,
            }
        },
        handleClick: function (e) {
            console.log(e);
            this.setState({
                clickCount: this.state.clickCount + 1,
            });
            
        },
        render: function () {
            return (
                    <div>
                        <h2>点击下面按钮</h2>
                        <button onClick={this.handleClick}>点击我</button>
                        <p>你一共点击了：{this.state.clickCount}</p>
                    </div>
            )
        }
    });

    var clickComponent = ReactDOM.render(
            <ClickApp />,
            document.getElementById('app')
    )


</script>
</body>
</html>